home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 41 / Amiga Format CD41 (1999-06)(Future Publishing)(GB)[!][issue 1999-07].iso / -seriously_amiga- / graphics / picsize / picsize.readme < prev    next >
Text File  |  1999-04-19  |  5KB  |  169 lines

  1. Short:    Shows picture dimensions using datatypes
  2. Kurz:     Zeigt Bildausmaße anhand Datatypes
  3. Author:   raresoft@rz.fh-augsburg.de (Ralph Reuchlein)
  4. Uploader: raresoft@rz.fh-augsburg.de (Ralph Reuchlein)
  5. Type:     util/dtype
  6. Version:  1.0
  7.  
  8.                                PicSize
  9.                                =======
  10.  
  11.  
  12. PURPOSE
  13.  
  14.    The archive contains a small program to determine picture
  15.    dimensions including the sources.
  16.  
  17.    Since I am working alot with images that were downloaded from
  18.    Aminet or other internet sources, were made by myself or were
  19.    generated by software, sometimes its useful to list image
  20.    dimensions instead of showing them or using other image viewers
  21.    with verbose output.
  22.  
  23.    This picture dimension determiner is based on the datatypes system
  24.    which is available since OS 3.0. Therefore you can scan each image
  25.    which datatype you have installed on your system.
  26.  
  27.    The sources is only one C source :-) This file should be compatible
  28.    to each compiler and contains features like Templates and
  29.    ReadArgs(), functions with variable arguments and -of course- the
  30.    simple datatype handling.
  31.  
  32.  
  33.  
  34. INSTALL
  35.  
  36.    Simply unpack the archive to anywhere you want.
  37.  
  38.  
  39.  
  40. REQUIREMENTS
  41.  
  42.    - OS 3.0
  43.    - datatypes for your image types
  44.  
  45.  
  46.  
  47. USAGE
  48.  
  49.    The template is
  50.  
  51.       PICTURE=PIC/A,WIDTH/S,HEIGHT/S,SIZE/S,DEPTH/S,FORMAT/S,FULL/S
  52.  
  53.    You always have to provide the image file you want to determine.
  54.    Without any of the switches (each template with '/S') you will get
  55.    the full information about the image:
  56.  
  57.       > picsize scully03.jpg 
  58.       scully03.jpg                    522x317x24, JFIF
  59.  
  60.    Column 1 displays the filename (without path), then the image
  61.    dimension with width, height and depth is shown and finally the
  62.    internal base name of the datatype is displayed.
  63.  
  64.    The same output is done with option FULL.
  65.  
  66.    The other switches can only be used standalone except WIDTH and
  67.    HEIGHT. If you only use the switch DEPTH, picsize will only output
  68.  
  69.       > picsize scully03.jpg DEPTH
  70.       24
  71.  
  72.    The same functionality is used for the other switches, too.
  73.  
  74.    There's only one exception: You can use WIDTH and HEIGHT together
  75.    for a output like this:
  76.  
  77.       > picsize scully03.jpg WIDTH HEIGHT
  78.       522x317
  79.  
  80.  
  81.    The main purpose of picsize is scripting. For example you can use
  82.    the script s:SPAT for a simple picture list:
  83.  
  84.       s:SPAT picsize IMAGES:xfiles/scully#?
  85.  
  86.    which prints:
  87.  
  88.       > s:spat picsize IMAGES:xfiles/scully#?
  89.       scully03.jpg                    522x317x24, JFIF
  90.       scully02.jpg                    476x328x24, JFIF
  91.       scully01.jpg                    476x365x24, JFIF
  92.  
  93.    Another example includes the command substitution feature of
  94.    CLI/Shell:
  95.  
  96.       > rename scully02.jpg as scully02_`picsize scully02.jpg WIDTH HEIGHT`.jpg
  97.  
  98.    This one would rename the file "scully02.jpg" as
  99.    "scully02_476x328.jpg".
  100.  
  101.  
  102.  
  103. BUGS
  104.  
  105.    Unfortunately there is a bug, but don't blame me for that, because
  106.    the error lies in the datatypes.
  107.  
  108.    The picture datatypes like ilbm.datatype or jfif.datatype first
  109.    unpack the image to CHIP RAM, then they build up a BitMap structure
  110.    and finally a BitMapHeader structure. The BitMapHeader structure
  111.    holds the information like width, height, depth and so on. If you
  112.    now try to open a huge image which bitmap can't be build in CHIP
  113.    MEM due to insufficient memory, picsize returns an error. Now the
  114.    bug strikes back: You might detect that the datatype system
  115.    grabbed a huge portion of CHIP RAM and the datatype forgot to free
  116.    it! You have no chance to free that unused memory; the only thing
  117.    is a reboot.
  118.  
  119.    But ...
  120.  
  121.    Good news for CyberGraphX V3 users: CGFX has a environment variable
  122.    PLANES2FAST which allowes swapping unused bitmaps to FAST RAM. If
  123.    the variable is set to 1, the datatype system builds the bitmaps in
  124.    FAST RAM. If you have 64 MB RAM, you can determine very huge images
  125.    without having a memory bug as described above. The variable
  126.    unfortunately has some negative side effects: Each program assuming
  127.    a bitmap in CHIP RAM would access on a non-allocated area in CHIP
  128.    RAM (remember, the bitmap is swapped to FAST RAM!) that surely
  129.    leads to system crashes.
  130.  
  131.  
  132.  
  133. DISCLAIMER
  134.  
  135.    THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS"
  136.    AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
  137.    TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
  138.    PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR
  139.    CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  140.    SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  141.    LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  142.    USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  143.    ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  144.    OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  145.    OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  146.    SUCH DAMAGE.
  147.  
  148.  
  149.  
  150. MISC
  151.  
  152.    Suggestions and bug reports are welcome, but I think the little
  153.    program's purpose is fully accomplished.
  154.  
  155.  
  156.  
  157. CONTACT
  158.  
  159.    snail  Ralph Reuchlein
  160.    mail:  Eibseestr. 18c
  161.           86163 Augsburg
  162.           GERMANY
  163.    
  164.    eMail: raresoft@rz.fh-augsburg.de (until July 1999)
  165.    WWW:   rr.home.pages.de
  166.    IRC:   RRipley on #germany
  167.  
  168.  
  169.